﻿import QtQuick 2.11

import com.leamus.gamedata 1.0

import "."
import "_Global"
import "_Global/Button"
import "_Global/Popup"

import "_Global/Global.js" as GlobalJS
import "GameJS.js" as GameJS

Popup {
    //property string playerAccount
    signal choiceRenWu(int rw);


    id: root
    color: "#7FFFFFFF"

    animationType: "fade"           //出现动画类型
    duration: 500                  //动画时间
    easingType: Easing.Linear       //动画效果
    bDrag: false

    showMask: false
    maskParent: root
    maskColor: 'black'
    maskOpacity: 0.5


    function init() {
    }


    /*
    Image { //背景
        id: backImage
        source: Global._FixResourcePath_R("Media/Images/Game/GameOver/Back.png")
        anchors.fill: parent
    }*/


    ColorButton {
        x: Global.dpW(100)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("李雷")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            //console.debug("!!!!!!choiceRenWu:",WuJiangClass.Value_LiLei);
            choiceRenWu(WuJiangClass.Value_LiLei);
        }

        onButtonHold: {
            textTips.text = "7血";
        }
    }

    ColorButton {
        x: Global.dpW(200)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("韩梅梅")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_HanMeiMei);
        }

        onButtonHold: {
            textTips.text = "6血";
        }
    }

    ColorButton {
        x: Global.dpW(300)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("成吉思汗")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_ChengJiSiHan);
        }

        onButtonHold: {
            textTips.text = "蒙古帝国: 出牌阶段，你可以使用任意数量的考试。";
        }
    }

    ColorButton {
        x: Global.dpW(400)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("阿育王")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_AYuWang);
        }

        onButtonHold: {
            textTips.text = "锁定技，你使用考试指定一名角色为目标后，该角色须连续使用两张解答才能抵消。";
        }
    }

    ColorButton {
        x: Global.dpW(500)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("陈独秀")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_ChengDuXiu);
        }

        onButtonHold: {
            textTips.text = "回合开始阶段你可以无限回答单词，回答正确抽取一张牌，回答错误技能终止，但单词出现时间会递减。";
        }
    }

    ColorButton {
        x: Global.dpW(600)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("亚历山大")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_YaLiShanDa);
        }

        onButtonHold: {
            textTips.text = "君士坦丁：当你出考试被对方解答防御时，回答单词正确对方继续掉血。";
        }
    }

    ColorButton {
        x: Global.dpW(700)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("哥伦布")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_GeLunBu);
        }

        onButtonHold: {
            textTips.text = "大航海时代：你每受到一次伤害，回答单词正确，则目标来源选择一项：弃置两张手牌；或受到你对其造成的1点伤害。";
        }
    }

    ColorButton {
        x: Global.dpW(800)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("拿破仑")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_NaPoLun);
        }

        onButtonHold: {
            textTips.text = "战争之神:出牌阶段：当你使用考试指定一名角色为目标后，回答单词正确，此考试不可被闪避。";
        }
    }

    ColorButton {
        x: Global.dpW(900)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("凯撒")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_KaiSa);
        }

        onButtonHold: {
            textTips.text = "出牌阶段,你可以将你的一张手牌当高考使用,若高考没有对目标角色造成 伤害,你可以弃掉目标角色任意一张游戏牌,每回合限用一次.";
        }
    }

    ColorButton {
        x: Global.dpW(1000)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("旦丁")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_DanDing);
        }

        onButtonHold: {
            textTips.text = "神曲:回合以外,在没有解答的情况下，回答单词正确可以将任意手牌当解答使用。";
        }
    }

    ColorButton {
        x: Global.dpW(1100)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("达芬奇")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_DaFenQi);
        }

        onButtonHold: {
            textTips.text = "蒙娜丽莎的微笑:在没有考试的情况下，回答单词正确你可以将任意一张手牌当一次考试使用。";
        }
    }

    ColorButton {
        x: Global.dpW(1200)
        y: Global.dpH(100)
        width: Global.dpW(80)
        height: Global.dpH(50)

        Text {
            font.pixelSize: Global.dpH(24)
            text: qsTr("牛顿")
            anchors.fill: parent
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
        }

        onButtonClicked: {
            choiceRenWu(WuJiangClass.Value_NiuDun);
        }

        onButtonHold: {
            textTips.text = "作用力:受到考试攻击时，若你手里有考试可以对攻击你的目标打出，若没有回答单词正确可以用任意一张手牌替换成考试。";
        }
    }

    Text {
        id: textTips
        text: qsTr("text")
        x: Global.dpW(500)
        y: Global.dpH(300)
        width: Global.dpW(800)
        height: Global.dpH(600)
    }

    Component.onCompleted: {
    }
}
